var app = app || {};
app.setintervalTest = {};
app.setintervalTest.ballX = 0;
app.setintervalTest.direction = 1;

(function($) {
	$(function() {
		var ballX = app.setintervalTest.ballX;
		var direction = app.setintervalTest.direction;

		setInterval(function() {
			if (ballX < 0 || 300 < ballX) {
				direction *= -1;
			}
			ballX = ballX + (direction * 10);
			$('#ball').css('left', ballX);
		}, (1000 / 24));
	});
})(jQuery);